package com.gemme.gemme.view;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.gemme.gemme.R;

public class TuijianguanDialog {
    CenterDialog dialog;
    private String url;

    public void showDialog(Context mContext){
//new int[]{R.id.close}
        dialog = new CenterDialog(mContext, R.layout.tuijianguan_guize_dialog,
                new int[]{R.id.close});

        dialog.show();
        initView();
        dialog.setOnBottomItemClickListener(new CenterDialog.OnBottomItemClickListener() {
            @Override
            public void onBottomItemClick(CenterDialog dialog, View view) {
                switch (view.getId()) {
                    case R.id.close:
                        dialog.dismiss();
                        break;

                }
            }
        });
    }
    private void initView() {
        View view = dialog.getView();
        GmWebView gmwebview = view.findViewById(R.id.gmwebview);
        if(!TextUtils.isEmpty(url)){
            gmwebview.setUrl(url);
        }
    }

    public void setUrl(String url){

        this.url = url;
    }


}
